﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;

namespace Element.UI.Utilities
{
    /// <summary>
    /// 通用附加属性
    /// </summary>
    public class AttachProperies : DependencyObject
    {
        #region CornerRadius
        /// <summary>
        /// 获取 转角半径
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static CornerRadius GetCornerRadius(DependencyObject obj)
        {
            return (CornerRadius)obj.GetValue(CornerRadiusProperty);
        }

        /// <summary>
        /// 设置 转角半径
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="value"></param>
        public static void SetCornerRadius(DependencyObject obj, CornerRadius value)
        {
            obj.SetValue(CornerRadiusProperty, value);
        }

        /// <summary>
        /// 转角半径 附加依赖属性
        /// </summary>
        public static readonly DependencyProperty CornerRadiusProperty =
            DependencyProperty.RegisterAttached("CornerRadius", typeof(CornerRadius), typeof(AttachProperies), new PropertyMetadata(new CornerRadius(0)));
        #endregion

    }
}
